<template>
    <li :class="['mail-item', { unread: mail.unread }]">
      <span>{{ mail.from }}</span>
      <span>{{ mail.subject }}</span>
      <span>{{ formatDate(mail.timestamp) }}</span>
    </li>
  </template>
  <script>
  import dayjs from 'dayjs';
  export default {
    props: { mail: Object },
    methods: { formatDate(ts) { return dayjs(ts).format('MMM D'); } }
  };
  </script>